package ua.kharkiv.knure.karimov.Task2;

public class Circle {
	private double x;
	private double y;
	private double r;

	public Circle() {
		x = 0;
		y = 0;
		r = 0;
	}

	public Circle(double x, double y, double r) {
		this.x = x;
		this.y = y;
		this.r = r;
	}

	public void move(double dx, double dy) {
		x += dx;
		y += dy;
	}

	private double d(double x1, double y1,double x2, double y2){
		return (Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2)
				* (y1 - y2)));
	}
	public boolean isPointInCircle(double x, double y) {
		return d(this.x,this.y,x,y) <= r;
	}

	public boolean isCircleInCircle(Circle c) {
		return d(this.x,this.y,c.x,c.y)+c.r <= r;
	}
	
	@Override
	public String toString() {
		return "x:"+x+" y:"+y+" r:"+r;
	}
	public void print(){
		System.out.println(this);
	}
}
